Many hardware devices are intended to be used as components of larger systems, and the particular configuration of a system in which a hardware device will be used may not be known at the time the hardware device is manufactured. For example, point of sale systems are found in any number of configurations. Different point of sale systems may include terminals from different manufacturers, with the terminals using different memory, processors and operating systems. It may be desirable to include a bar code scanner as a component of such a system, and it may be desired to market a bar code scanner that can be incorporated into a variety of different point of sale systems without requiring any modification to the bar code scanner in order to adapt it for use in one system or another. One particularly convenient way to incorporate a scanner into a point of sale system is to connect the scanner to a universal serial bus (USB) port in the terminal in order to allow communication between the scanner and the terminal. The USB connection makes it easy to physically connect and disconnect a scanner from a terminal and this ease of connection and disconnection makes it easy to physically transfer a scanner from one point of sale system to another. Jumpers, DIP switches or other indicators may be set in order to indicate the configuration or operating environment in which the scanner is being used. The configuration or operating environment includes aspects such as the components used with the scanner, such as the particular design or brand of terminal with which the scanner is being used. A scanner that would adapt to such transfer without a need for significant modification to the hardware or software of the scanner would be highly desirable.
A scanner which can be connected to a USB port typically includes a USB controller to allow communication with the device or system to which the scanner is connected. Upon startup of the scanner, the scanner performs initialization. Initialization includes proper initialization of the USB controller. This initialization may suitably be performed by loading appropriate initialization routines from semipermanent memory such as an EEPROM into regular memory such as RAM and executing the routines.
Proper initialization requires that the correct routines be present in the EEPROM or other semipermanent memory and that they be selected, loaded into the correct location in RAM and executed properly. If a scanner is to be used in only one system configuration and with one terminal, the desired initialization routine can be stored in the EEPROM of the scanner. At power up of the scanner, the initialization routine is copied from the EEPROM into the RAM and executed. However, a scanner having only one stored initialization routine can be used only with the terminal configuration for which the initialization routine is adapted, unless the scanner is reprogrammed with a new initialization routine before use in a different configuration.
For many devices, it is possible to install a bootloader that will be executed upon power up of the device. Upon power up, the bootloader detects the configuration in which the device is being used, selects an initialization routine for use with the detected configuration and loads the selected initialization routine. However, a highly popular and widely used communication controller, to control USB connections with bar code scanners, employs hardware that requires a portion of the initialization routine to be loaded into a memory location that is accessible only under certain circumstances and that is inaccessible for reading and writing by the bootloader.
There exists, therefore, a need for techniques to allow automatic selection and loading of one of a number of available initialization routines and the proper loading of the initialization routines into the necessary memory locations.